package com.liangtian.mdm.base.exception;

import com.liangtian.mdm.base.constants.ResultCode;
import lombok.Data;

/**
 * 自定义异常
 * @author Qi
 */
@Data
public class BaseRuntimeException extends RuntimeException {
    /**
     * ResultCode的code值
     */
    private String code;

    public BaseRuntimeException(String code) {
        this.code = code;
    }

    public BaseRuntimeException(String code, Throwable e) {
        super(e);
        this.code = code;
    }

    public BaseRuntimeException(ResultCode resultCode, Throwable e) {
        super(e);
        this.code = resultCode.getCode();
    }

    public BaseRuntimeException(String code, String msg) {
        super(msg);
        this.code = code;
    }

    public BaseRuntimeException(String code, String msg, Throwable e) {
        super(msg, e);
        this.code = code;
    }
    
    public BaseRuntimeException() {
        super();
    }
}

